<?php
/**
 * Moduleadmin_Model_Deletemodule
 * delete module model
 * @author Adrian Stolarski
 */
class Moduleadmin_Model_Deletemodule implements Moduleadmin_Model_Mainable {
    
    /**
     *
     * @var type $current_action
     * current action handler
     */
    public $current_action;
    
    /**
     * main()
     * check initialise data and delete current module
     * @param array $variables
     */
    public function main(array $variables = null) {
        //var_dump($variables);
        //die();
        if(isset($variables['module_name']) 
                && !is_null($variables['module_name']) 
                && !is_null($variables) 
                && (trim($variables['module_name'] != ''))){
            $this->current_action = new Moduleadmin_Data_Deletemodule;
            $this->current_action->main($variables);
        }
        else {
            $this->current_action = new Moduleadmin_Data_Modulelistredirect;
            $this->current_action->main($variables);
        }
    }

}
